package cn.codesugar.data.storage

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import cn.codesugar.data.storage.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {

    private var b: ActivityMainBinding? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        b = ActivityMainBinding.inflate(layoutInflater)
        setContentView(b?.root)
        b?.btnFile?.setOnClickListener {
            startActivity(Intent(this, FilePersistenceTestActivity::class.java))
        }
        b?.btnSharedPreferences?.setOnClickListener {
            startActivity(Intent(this, SharedPreferencesTestActivity::class.java))
        }
        b?.btnSQLite?.setOnClickListener {
            startActivity(Intent(this, DatabaseTestActivity::class.java))
        }
    }
}